import Vue from 'vue'
import Vuex from 'vuex'
//导入persistedState
import persistedState from 'vuex-persistedstate'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    //登录
    token:'',
    login:[],
    //面包屑
    bread:[]
  },
  mutations: {
    login(state,obj){
      state.token=obj.token
      state.login.push(obj)
    },
    //退出
    log(state){
      state.token=''
      state.login=[]
    },
    //面包屑
    addbread(state ,path){
      state.bread=path
    }
  },
  actions: {
  },
  modules: {
  },
  plugins: [persistedState()]
})
